<html>
<head><meta charset="utf-8"><title>meeting 06.02.2020 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html">meeting 06.02.2020</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199544881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199544881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199544881">(Jun 02 2020 at 19:59)</a>:</h4>
<p>Hi <span class="user-group-mention" data-user-group-id="692">@WG-traits</span>, almost meeting time</p>



<a name="199544950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199544950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199544950">(Jun 02 2020 at 20:00)</a>:</h4>
<p>Decided to drop the "design" part of the topic</p>



<a name="199544994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199544994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199544994">(Jun 02 2020 at 20:00)</a>:</h4>
<p>Since we usually do a mix of design, triage, etc.</p>



<a name="199545002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545002">(Jun 02 2020 at 20:00)</a>:</h4>
<p>Good with everyone?</p>



<a name="199545067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545067">(Jun 02 2020 at 20:01)</a>:</h4>
<p>I've also been thinking the title is outdated</p>



<a name="199545099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545099">(Jun 02 2020 at 20:01)</a>:</h4>
<p>Did we pick a topic for this meeting last time, or is that still up in the air?</p>



<a name="199545223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545223">(Jun 02 2020 at 20:02)</a>:</h4>
<blockquote>
<p>Possible future meeting topics<br>
- implied bounds – continuing from last meeting<br>
- how to manage consts in chalk writer<br>
- shared type library next steps<br>
- wf checks on types<br>
-   chalk’s support for coherence</p>
</blockquote>



<a name="199545259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545259">(Jun 02 2020 at 20:02)</a>:</h4>
<p>link: <a href="https://hackmd.io/nrhN5A8sR2eY9UdfJTKcJg">https://hackmd.io/nrhN5A8sR2eY9UdfJTKcJg</a></p>



<a name="199545330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545330">(Jun 02 2020 at 20:03)</a>:</h4>
<p>I didn't realize someone had added those hehe</p>



<a name="199545345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545345">(Jun 02 2020 at 20:03)</a>:</h4>
<p>I think I typed them in :)</p>



<a name="199545396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545396">(Jun 02 2020 at 20:03)</a>:</h4>
<p>I don't think we had any conversation about it last week (there's....been a lot going on)</p>



<a name="199545456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545456">(Jun 02 2020 at 20:04)</a>:</h4>
<p>One thing that I had thought about this weekend</p>



<a name="199545466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545466">(Jun 02 2020 at 20:04)</a>:</h4>
<p>and maybe we might want to discuss a bit</p>



<a name="199545490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545490">(Jun 02 2020 at 20:04)</a>:</h4>
<p>is subtyping, and how we want to handle it in chalk</p>



<a name="199545515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545515">(Jun 02 2020 at 20:04)</a>:</h4>
<p>yeah, we could talk about that</p>



<a name="199545538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545538">(Jun 02 2020 at 20:04)</a>:</h4>
<p>(though, I also didn't realize there was an issue already with a bit of guidance, or forgot)</p>



<a name="199545541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545541">(Jun 02 2020 at 20:04)</a>:</h4>
<p><a href="https://github.com/rust-lang-nursery/chalk/issues/418">chalk#418</a></p>



<a name="199545595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545595">(Jun 02 2020 at 20:05)</a>:</h4>
<p>yeah, I left some notes, not too detailed</p>



<a name="199545609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545609">(Jun 02 2020 at 20:05)</a>:</h4>
<p>maybe enough for an intrepid person to piece it together :)</p>



<a name="199545640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545640">(Jun 02 2020 at 20:05)</a>:</h4>
<p>but I'd be happy to talk it out in a bit more detail</p>



<a name="199545671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545671">(Jun 02 2020 at 20:05)</a>:</h4>
<p>Anyways, looking that over. Is it "blocked" on sem-syn equality?</p>



<a name="199545682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545682">(Jun 02 2020 at 20:05)</a>:</h4>
<p>(should we open the floor for updates/general questions first?)</p>



<a name="199545773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545773">(Jun 02 2020 at 20:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199545671">said</a>:</p>
<blockquote>
<p>Anyways, looking that over. Is it "blocked" on sem-syn equality?</p>
</blockquote>
<p>I don't... think so... let me re-read :)</p>



<a name="199545781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545781">(Jun 02 2020 at 20:06)</a>:</h4>
<p>0.11.0 is published :)</p>



<a name="199545803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545803">(Jun 02 2020 at 20:06)</a>:</h4>
<p>that's awesome</p>



<a name="199545825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545825">(Jun 02 2020 at 20:06)</a>:</h4>
<p>after a bit of trying to get things going</p>



<a name="199545853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545853">(Jun 02 2020 at 20:06)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="254853">@pksunkara</span></p>



<a name="199545941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545941">(Jun 02 2020 at 20:07)</a>:</h4>
<p>Yep, nice to see the crates here: <a href="https://crates.io/crates/chalk-engine">https://crates.io/crates/chalk-engine</a></p>



<a name="199545974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199545974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199545974">(Jun 02 2020 at 20:07)</a>:</h4>
<p>Other than that, I feel like it's been a pretty calm week</p>



<a name="199546011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546011">(Jun 02 2020 at 20:07)</a>:</h4>
<p>I mentioned I was working on some docs for the recursive solver</p>



<a name="199546017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546017">(Jun 02 2020 at 20:07)</a>:</h4>
<p>Yeah, looking at merged PRs, it's mostly some refactorings</p>



<a name="199546108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546108">(Jun 02 2020 at 20:08)</a>:</h4>
<p>I think the number of open PRs has been cut down quite a lot since last week, good job on that!</p>



<a name="199546157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546157">(Jun 02 2020 at 20:08)</a>:</h4>
<p>I've been run kind of ragged last few weeks, I want to start opening up issues for folks, but I'm finding it hard to get enough context to figure out what to open :P</p>



<a name="199546203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546203">(Jun 02 2020 at 20:09)</a>:</h4>
<p>too many things going on?</p>



<a name="199546226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546226">(Jun 02 2020 at 20:09)</a>:</h4>
<p>but if anybody has suggestions -- things they want to do but feel a bit blocked -- do ask</p>



<a name="199546231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546231">(Jun 02 2020 at 20:09)</a>:</h4>
<p>There was actually a pretty big/important PR related to chalk-engine that got merged</p>



<a name="199546349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546349">(Jun 02 2020 at 20:10)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="232957">@Jack Huey</span> we should add <a href="https://github.com/rust-lang-nursery/chalk/issues/418">chalk#418</a> to the "extend chalk-solve to support Rust semantics", I guess</p>



<a name="199546354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546354">(Jun 02 2020 at 20:10)</a>:</h4>
<p>I think the recursive solver docs have been quite useful</p>



<a name="199546358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546358">(Jun 02 2020 at 20:10)</a>:</h4>
<p>that goal is a bit narrow</p>



<a name="199546388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546388">(Jun 02 2020 at 20:10)</a>:</h4>
<p>Bleh I'm building LLVM locally and my computer is just churning for everything lol</p>



<a name="199546426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546426">(Jun 02 2020 at 20:10)</a>:</h4>
<p>that is, I think the "goal" is probably "extend chalk to support Rust semantics" more than chalk-solve particularly</p>



<a name="199546439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546439">(Jun 02 2020 at 20:10)</a>:</h4>
<p>indeed</p>



<a name="199546714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546714">(Jun 02 2020 at 20:12)</a>:</h4>
<p>Also looking through the sprint goals</p>



<a name="199546751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546751">(Jun 02 2020 at 20:13)</a>:</h4>
<p>crate structure got cleaned up a lot</p>



<a name="199546779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546779">(Jun 02 2020 at 20:13)</a>:</h4>
<p>so chalk-engine now depends on chalk-ir, instead of the other way around</p>



<a name="199546907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546907">(Jun 02 2020 at 20:14)</a>:</h4>
<p>huh, sounds they're not too tightly coupled then, if you can switch that around</p>



<a name="199546908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546908">(Jun 02 2020 at 20:14)</a>:</h4>
<p>The only thing left from the original "crate structure, publish" goal is setting up bors-ng</p>



<a name="199546991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199546991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199546991">(Jun 02 2020 at 20:14)</a>:</h4>
<p>well, and "integrate recursive/slg solvers at compatable level"</p>



<a name="199547043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547043">(Jun 02 2020 at 20:14)</a>:</h4>
<p>we far as "improve caching strategy for recursive solver", there's been a lot of good "thinking"</p>



<a name="199547089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547089">(Jun 02 2020 at 20:15)</a>:</h4>
<p><span class="user-mention" data-user-id="283967">@Zahari Dichev</span> has a draft PR about coinduction, and we had a long chat about an alternative approach, and I sketched out some docs + how salsa might look</p>



<a name="199547096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547096">(Jun 02 2020 at 20:15)</a>:</h4>
<p><span class="user-mention" data-user-id="125131">@detrumi</span> so it was pretty easy, since chalk-engine basically needed all the types, but used them as associated types on <code>Context</code></p>



<a name="199547143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547143">(Jun 02 2020 at 20:15)</a>:</h4>
<p>At some point I think we decided to leave the recursive solver as is instead of abstracting it, to avoid unnecessary work? <span class="user-mention" data-user-id="232957">@Jack Huey</span> do you remember this?</p>



<a name="199547150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547150">(Jun 02 2020 at 20:15)</a>:</h4>
<p>I was thinking that a good place to start might be to try "separating" out the parts of recursive solver I think salsa could handle from the rest, so we can see how the two interact</p>



<a name="199547168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547168">(Jun 02 2020 at 20:15)</a>:</h4>
<p>and <code>chalk-ir</code> only really need the debug macros and a couple types from <code>chalk-engine</code>and <code>chalk-base</code></p>



<a name="199547267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547267">(Jun 02 2020 at 20:16)</a>:</h4>
<p>I do think that the recursive/SLG solvers ought to live at a comparable place</p>



<a name="199547271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547271">(Jun 02 2020 at 20:16)</a>:</h4>
<p>Well, now that the dependency is switched around, it might be useful to take a look again to see if it's worth abstracting it out</p>



<a name="199547279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547279">(Jun 02 2020 at 20:16)</a>:</h4>
<p>that said, there is one other thing about the recursive solver</p>



<a name="199547300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547300">(Jun 02 2020 at 20:17)</a>:</h4>
<p>that is worth mentioning here</p>



<a name="199547327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547327">(Jun 02 2020 at 20:17)</a>:</h4>
<p>I'd like to alter it to separate "shared state" from "state for a single session"</p>



<a name="199547354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547354">(Jun 02 2020 at 20:17)</a>:</h4>
<p>in particular, it has a "cache" that would be (I think) global, and probably guarded by a mutex</p>



<a name="199547396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547396">(Jun 02 2020 at 20:17)</a>:</h4>
<p>but when you solve a specific query, you could do that in parallel from multiple threads (the stack / search graph would be local to each thread)</p>



<a name="199547407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547407">(Jun 02 2020 at 20:17)</a>:</h4>
<p>it might be interesting to try and factor out the API to figure out how we would expose that</p>



<a name="199547413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547413">(Jun 02 2020 at 20:18)</a>:</h4>
<p>I don't .. know how SLG can be factored this way</p>



<a name="199547462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547462">(Jun 02 2020 at 20:18)</a>:</h4>
<p>I can think of a way :)</p>



<a name="199547474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547474">(Jun 02 2020 at 20:18)</a>:</h4>
<p>(to make SLG multithreaded)</p>



<a name="199547508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zahari Dichev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547508">(Jun 02 2020 at 20:18)</a>:</h4>
<p>what about the "locked" queries that you mentioned briefly in the docs. How would you determine which one should be locked or not ?</p>



<a name="199547520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547520">(Jun 02 2020 at 20:18)</a>:</h4>
<p>I'm interesting to hear about it, but my main point here was that it may impact the "public API" we want, though I think it shouldn't really hold us off from refactoring</p>



<a name="199547560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547560">(Jun 02 2020 at 20:19)</a>:</h4>
<p>whereever we end up I think if we have multiple solvers they should ideally be factored to a single interface that works in comparable ways</p>



<a name="199547592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547592">(Jun 02 2020 at 20:19)</a>:</h4>
<p>That would be nice</p>



<a name="199547615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547615">(Jun 02 2020 at 20:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="283967">Zahari Dichev</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199547508">said</a>:</p>
<blockquote>
<p>what about the "locked" queries that you mentioned briefly in the docs. How would you determine which one should be locked or not ?</p>
</blockquote>
<p>(that's not really related to chalk, but more to other things in rust-analyzer/salsa, but it comes down to whether the output is deterministic and/or very expensive)</p>



<a name="199547767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547767">(Jun 02 2020 at 20:20)</a>:</h4>
<p>so on a  related note</p>



<a name="199547793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547793">(Jun 02 2020 at 20:20)</a>:</h4>
<p>when we landed the predicate refactoring in <a href="https://github.com/rust-lang/rust/issues/72055">#72055</a> -- towards the "GAT support in rustc" goal but also the "shraed library represetnting types"</p>



<a name="199547814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547814">(Jun 02 2020 at 20:21)</a>:</h4>
<p>there was some perf hit, though I think <span class="user-mention" data-user-id="216206">@lcnr</span> has mostly recovered it now</p>



<a name="199547908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547908">(Jun 02 2020 at 20:21)</a>:</h4>
<p>anyway I was thinking about the steps I listed under "extracting a shared library", and trying to figure out how much to start making those changes incrementally -- do we have to know more about our ultimate direction we starting to add <code>kind</code> and so forth?</p>



<a name="199547934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547934">(Jun 02 2020 at 20:21)</a>:</h4>
<p>that is, starting to modify rustc to do <code>ty.kind()</code> instead of <code>ty.kind</code></p>



<a name="199547944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199547944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199547944">(Jun 02 2020 at 20:21)</a>:</h4>
<p>and eventually <code>ty.kind(tcx)</code></p>



<a name="199548004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548004">(Jun 02 2020 at 20:22)</a>:</h4>
<p>anyway I felt a bit of hesitation, although right now I feel like I'm not sure why I was hesitating</p>



<a name="199548015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548015">(Jun 02 2020 at 20:22)</a>:</h4>
<p>I guess just because it's invasive</p>



<a name="199548079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548079">(Jun 02 2020 at 20:22)</a>:</h4>
<p>I'll probably make an MCP for that to describe it but I think it's a good candidate for someone who wants to poke at rustc</p>



<a name="199548142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548142">(Jun 02 2020 at 20:23)</a>:</h4>
<p>Yeah, I think performance is something we really want to keep an eye on</p>



<a name="199548157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548157">(Jun 02 2020 at 20:23)</a>:</h4>
<p>I don't think this change will have perf impact</p>



<a name="199548165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548165">(Jun 02 2020 at 20:23)</a>:</h4>
<p>I'd like to get a bit more into rustc dev at some point (will build a new pc soon so I'll have more cores, which would be nice first)</p>



<a name="199548176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548176">(Jun 02 2020 at 20:23)</a>:</h4>
<p>the predicate impact was largely caused by adding interning (and hence hashing)</p>



<a name="199548222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548222">(Jun 02 2020 at 20:23)</a>:</h4>
<p>Well, we do a lot of interning in Chalk</p>



<a name="199548279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548279">(Jun 02 2020 at 20:24)</a>:</h4>
<p>point being, we already intern types in rustc</p>



<a name="199548288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548288">(Jun 02 2020 at 20:24)</a>:</h4>
<p>So maybe we need to think about being more careful with it</p>



<a name="199548323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548323">(Jun 02 2020 at 20:24)</a>:</h4>
<p>I guess this is orthogonal though</p>



<a name="199548344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548344">(Jun 02 2020 at 20:24)</a>:</h4>
<p>we may want to have some helper like</p>



<a name="199548359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548359">(Jun 02 2020 at 20:24)</a>:</h4>
<p><code>p.intern_if_changed(q)</code></p>



<a name="199548379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548379">(Jun 02 2020 at 20:24)</a>:</h4>
<p>which would be used during folding</p>



<a name="199548419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548419">(Jun 02 2020 at 20:25)</a>:</h4>
<p>the idea woud be: check first if <code>p == q.data()</code> and, if so, just return <code>q</code></p>



<a name="199548449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548449">(Jun 02 2020 at 20:25)</a>:</h4>
<p>this is roughly the optimization we did for predicate construction</p>



<a name="199548480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548480">(Jun 02 2020 at 20:25)</a>:</h4>
<p>anyway I think the lesson learned for <em>rustc</em> is -- whenever we are going to add new interning, do perf runs first, and try to optimize before landing :)</p>



<a name="199548591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548591">(Jun 02 2020 at 20:26)</a>:</h4>
<p>sounds good</p>



<a name="199548595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548595">(Jun 02 2020 at 20:26)</a>:</h4>
<p>I'm skimming down the list of goals, looking for places where we might have updates</p>



<a name="199548617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548617">(Jun 02 2020 at 20:26)</a>:</h4>
<p>for opaque types, any updates <span class="user-mention" data-user-id="125131">@detrumi</span>? we did land some PRs</p>



<a name="199548665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548665">(Jun 02 2020 at 20:27)</a>:</h4>
<p>there was a list for that somewhere right</p>



<a name="199548666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548666">(Jun 02 2020 at 20:27)</a>:</h4>
<p>Still need to dive into the WF checks</p>



<a name="199548700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548700">(Jun 02 2020 at 20:27)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/issues/335#issuecomment-615254659">https://github.com/rust-lang/chalk/issues/335#issuecomment-615254659</a></p>



<a name="199548780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548780">(Jun 02 2020 at 20:27)</a>:</h4>
<p>Ah, forgot to check one off</p>



<a name="199548829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548829">(Jun 02 2020 at 20:28)</a>:</h4>
<p>Looks like it's getting close though</p>



<a name="199548856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548856">(Jun 02 2020 at 20:28)</a>:</h4>
<p>ok, should we discuss subtyping?</p>



<a name="199548944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548944">(Jun 02 2020 at 20:29)</a>:</h4>
<p>Is there a concrete code example that might help explain it? The issue is a bit confusing</p>



<a name="199548945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548945">(Jun 02 2020 at 20:29)</a>:</h4>
<p>Yes</p>



<a name="199548948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548948">(Jun 02 2020 at 20:29)</a>:</h4>
<p>(some harder details left such as implied bound interactions, but those might not be that important at first)</p>



<a name="199548977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548977">(Jun 02 2020 at 20:29)</a>:</h4>
<p><span class="user-mention" data-user-id="218805">@Mark Drobnak</span> do you mean opaque types or subtyping?</p>



<a name="199548986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199548986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199548986">(Jun 02 2020 at 20:29)</a>:</h4>
<p>subtyping</p>



<a name="199549074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549074">(Jun 02 2020 at 20:30)</a>:</h4>
<p><a href="https://github.com/rust-lang-nursery/chalk/issues/418">chalk#418</a> right?</p>



<a name="199549083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549083">(Jun 02 2020 at 20:30)</a>:</h4>
<p>Ya</p>



<a name="199549110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549110">(Jun 02 2020 at 20:30)</a>:</h4>
<p>well, I'm not sure what kind of <em>code example</em> we would give exactly,</p>



<a name="199549120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549120">(Jun 02 2020 at 20:30)</a>:</h4>
<p>perhaps this</p>



<a name="199549132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549132">(Jun 02 2020 at 20:30)</a>:</h4>
<p>you might have a rust program like</p>



<a name="199549160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549160">(Jun 02 2020 at 20:30)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="na">&#39;a</span><span class="w"> </span><span class="kt">u32</span><span class="p">,</span><span class="w"> </span><span class="n">y</span>: <span class="kp">&amp;</span><span class="na">&#39;b</span><span class="w"> </span><span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">p</span>: <span class="nc">_</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="n">something</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">y</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="199549236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549236">(Jun 02 2020 at 20:31)</a>:</h4>
<p>so here, the type of <code>p</code> is being inferred</p>



<a name="199549248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549248">(Jun 02 2020 at 20:31)</a>:</h4>
<p>this is really outside the realm of chalk to some extent but</p>



<a name="199549259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549259">(Jun 02 2020 at 20:31)</a>:</h4>
<p>btw I found this chapter in the rustc-dev-guide to be helpful: <a href="https://rustc-dev-guide.rust-lang.org/variance.html">https://rustc-dev-guide.rust-lang.org/variance.html</a></p>



<a name="199549290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549290">(Jun 02 2020 at 20:32)</a>:</h4>
<p>the type of <code>x</code> is <code>&amp;'a u32</code></p>



<a name="199549356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549356">(Jun 02 2020 at 20:32)</a>:</h4>
<p>but the type of <code>p</code> would be <code>&amp;'r u32</code> where <code>'r</code> is some other region,</p>



<a name="199549380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549380">(Jun 02 2020 at 20:32)</a>:</h4>
<p>and we have the constraints that <code>'a: 'r</code> and <code>'b: 'r</code> (from the second <code>p = y</code> assignment)</p>



<a name="199549470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549470">(Jun 02 2020 at 20:33)</a>:</h4>
<p>so you could imagine that rustc would be generating <code>Subtype(&amp;'a u32, ?P)</code> goals for something like <code>let p: _ = x</code>, where <code>?P</code> is the inference variable for the type of <code>p</code></p>



<a name="199549546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549546">(Jun 02 2020 at 20:33)</a>:</h4>
<p>there is code in rustc to do this</p>



<a name="199549623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549623">(Jun 02 2020 at 20:34)</a>:</h4>
<p>chalk however only has code for "unification" -- meaning making types <strong>equal</strong> -- and that code is also a bit wrong</p>



<a name="199549638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549638">(Jun 02 2020 at 20:34)</a>:</h4>
<p>this is because, in trait matching, we don't typically get subtyping relationships</p>



<a name="199549673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549673">(Jun 02 2020 at 20:34)</a>:</h4>
<p>basically because rust trait matching is defined to work on exactly the same types ("invariant")</p>



<a name="199549727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549727">(Jun 02 2020 at 20:35)</a>:</h4>
<p>but in rustc we have these subtyping predicates for various reasons, and it turns out that to really get "type equality" right, we kind of need them too anyhow</p>



<a name="199549759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549759">(Jun 02 2020 at 20:35)</a>:</h4>
<p>not sure <span class="user-mention" data-user-id="218805">@Mark Drobnak</span> if that "sets the stage" a bit better?</p>



<a name="199549772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549772">(Jun 02 2020 at 20:35)</a>:</h4>
<p>Ya, that helps, thanks!</p>



<a name="199549885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549885">(Jun 02 2020 at 20:36)</a>:</h4>
<p>so I'm reading over what I wrote in <a href="https://github.com/rust-lang-nursery/chalk/issues/418">chalk#418</a></p>



<a name="199549931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549931">(Jun 02 2020 at 20:37)</a>:</h4>
<p>I'm not sure what is most fruitful to talk about, maybe <span class="user-mention" data-user-id="232957">@Jack Huey</span> you have a question?</p>



<a name="199549995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199549995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199549995">(Jun 02 2020 at 20:37)</a>:</h4>
<p>I'm not entirely sure why I said "Separate semantic from syntactic equality" was a necessary step</p>



<a name="199550048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550048">(Jun 02 2020 at 20:38)</a>:</h4>
<p>but anyway I can explain a bit how rustc handles things like <code>T1 &lt;: T2</code> and so forth</p>



<a name="199550156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550156">(Jun 02 2020 at 20:38)</a>:</h4>
<p>if you're familiar with chalk's unification code, the "core bit" is kind of similar to the <code>Zip</code> trait -- i.e., we walk down the types we are unifying, matching up their structures</p>



<a name="199550174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550174">(Jun 02 2020 at 20:39)</a>:</h4>
<p><code>T1 &lt;: T2</code> means a type/lifetime T2 lives longer than T2?</p>



<a name="199550191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550191">(Jun 02 2020 at 20:39)</a>:</h4>
<p>I guess, the question is, working backwards, if we have a <code>Subtype</code> goal, how would chalk solve that</p>



<a name="199550196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550196">(Jun 02 2020 at 20:39)</a>:</h4>
<p>sorry, <code>T1 &lt;: T2</code> means "<code>T1</code> is a subtype of <code>T2</code>"</p>



<a name="199550226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550226">(Jun 02 2020 at 20:39)</a>:</h4>
<p><code>T1 == T2</code> means <code>T1</code> is the same type as <code>T2</code></p>



<a name="199550233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550233">(Jun 02 2020 at 20:39)</a>:</h4>
<p>which implies both <code>T1 &lt;: T2</code> and <code>T2 &lt;: T1</code></p>



<a name="199550297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550297">(Jun 02 2020 at 20:40)</a>:</h4>
<p>that is, <code>T1 &lt;: T2, T2 &lt;: T1</code> if and only if <code>T1 == T2</code></p>



<a name="199550320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550320">(Jun 02 2020 at 20:40)</a>:</h4>
<p>at least that is the desired relationship :)</p>



<a name="199550327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550327">(Jun 02 2020 at 20:40)</a>:</h4>
<p>it is more or less the same as <code>&lt;=</code> with numbers</p>



<a name="199550360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550360">(Jun 02 2020 at 20:40)</a>:</h4>
<p>i.e., <code>T1 &lt;: T2</code> if <code>T1</code> represents some smaller set of values, all of which are also part of the set <code>T2</code>...</p>



<a name="199550361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550361">(Jun 02 2020 at 20:40)</a>:</h4>
<p>anyway</p>



<a name="199550399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550399">(Jun 02 2020 at 20:40)</a>:</h4>
<p>(at least that is one way to interpret types)</p>



<a name="199550403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550403">(Jun 02 2020 at 20:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199550191">said</a>:</p>
<blockquote>
<p>I guess, the question is, working backwards, if we have a <code>Subtype</code> goal, how would chalk solve that</p>
</blockquote>
<p>circling back to this</p>



<a name="199550434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550434">(Jun 02 2020 at 20:41)</a>:</h4>
<p>(let's not get into lattices now <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> )</p>



<a name="199550461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550461">(Jun 02 2020 at 20:41)</a>:</h4>
<p>rustc actually has two copies of the code that handles this, but I think the <a href="https://github.com/rust-lang/rust/blob/db98d32ea04438cf759b749d5cbeba4f77222664/src/librustc_infer/infer/nll_relate/mod.rs#L696"><code>nll_relate</code></a> code is the one I would want to emulate</p>



<a name="199550493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550493">(Jun 02 2020 at 20:41)</a>:</h4>
<p>and basically the idea is that just as unification kind of "zips" down the type structure</p>



<a name="199550550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550550">(Jun 02 2020 at 20:42)</a>:</h4>
<p>we do the same thing, but we carry with us a "direction" (what we call the "ambient variance", which is a term I kind of made up)</p>



<a name="199550601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550601">(Jun 02 2020 at 20:42)</a>:</h4>
<p>so basically we always have a left (<code>a</code>) and a right (<code>b</code>) "thing"</p>



<a name="199550622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550622">(Jun 02 2020 at 20:42)</a>:</h4>
<blockquote>
<p>This code is intended for use in NLL and chalk</p>
</blockquote>
<p>Huh, interesting</p>



<a name="199550644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550644">(Jun 02 2020 at 20:42)</a>:</h4>
<p>but we might be checking one of three things:</p>
<ul>
<li><code>a &lt;: b</code></li>
<li><code>a :&gt; b</code> (same as <code>b &lt;: a</code>)</li>
<li><code>a == b</code></li>
</ul>



<a name="199550705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550705">(Jun 02 2020 at 20:43)</a>:</h4>
<p>which one we are enforcing is determined by the ambient variance</p>



<a name="199550727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550727">(Jun 02 2020 at 20:43)</a>:</h4>
<ul>
<li>covariant == <code>a &lt; :b</code></li>
<li>contravariant == <code>b &lt;: a</code></li>
<li>invariant == <code>a == b</code></li>
</ul>



<a name="199550792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550792">(Jun 02 2020 at 20:44)</a>:</h4>
<p><code>a</code> and <code>b</code> might not be types, so you can kind of extend the concept...e.g. to regions</p>



<a name="199550827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550827">(Jun 02 2020 at 20:44)</a>:</h4>
<p>actually how regions/lifetimes and "variance" interact is an itneresting question let me check what the code did :)</p>



<a name="199550841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550841">(Jun 02 2020 at 20:44)</a>:</h4>
<p>but the bottom line is that you are enforcing</p>



<a name="199550869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550869">(Jun 02 2020 at 20:45)</a>:</h4>
<p>one of the following</p>
<ul>
<li><code>'a: 'b</code></li>
<li><code>'b: 'a</code></li>
<li><code>'a == 'b</code> (which is the same as <code>'a: 'b</code> and <code>'b: 'a</code>)</li>
</ul>



<a name="199550881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550881">(Jun 02 2020 at 20:45)</a>:</h4>
<p>Yeah, I guess types with possible subtypes is the same as regions with possible subregions</p>



<a name="199550920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550920">(Jun 02 2020 at 20:45)</a>:</h4>
<p>so with lifetimes as they are currently defined in rustc we usually call <code>'a: 'b</code> "contravariant", basically, because <code>'a: 'b</code> is kind of <code>'a &gt;= 'b</code></p>



<a name="199550932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550932">(Jun 02 2020 at 20:45)</a>:</h4>
<p>I suspect that's what the code does now</p>



<a name="199550947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550947">(Jun 02 2020 at 20:45)</a>:</h4>
<p>so for example <code>'static: 'x</code> is true for all <code>'x</code> beacuse it is the "longest lifetime" (largest)</p>



<a name="199550950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mark Drobnak <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550950">(Jun 02 2020 at 20:45)</a>:</h4>
<p>At some point for types, will it always come down to lifetimes? Or can types be subtypes without lifetimes involved?</p>



<a name="199550960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199550960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199550960">(Jun 02 2020 at 20:45)</a>:</h4>
<p>(polonius kind of messes with this)</p>



<a name="199551031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551031">(Jun 02 2020 at 20:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="218805">Mark Drobnak</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199550950">said</a>:</p>
<blockquote>
<p>At some point for types, will it always come down to lifetimes? Or can types be subtypes without lifetimes involved?</p>
</blockquote>
<p>in rust, it always comes down to lifetimes, though sometimes it comes down to binding of lifetimes and not just relationships of lifetimes</p>



<a name="199551117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551117">(Jun 02 2020 at 20:46)</a>:</h4>
<p>i.e., <code>for&lt;'a, 'b&gt; fn(&amp;'a u32, &amp;'b u32) -&gt; &amp;'a u32</code> and <code>for&lt;'a&gt; fn(&amp;'a u32, &amp;'a u32) -&gt; &amp;'a u32</code> have a relationship</p>



<a name="199551125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551125">(Jun 02 2020 at 20:47)</a>:</h4>
<p>the first one returns its first argment always</p>



<a name="199551141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551141">(Jun 02 2020 at 20:47)</a>:</h4>
<p>(or a static)</p>



<a name="199551146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551146">(Jun 02 2020 at 20:47)</a>:</h4>
<p>the second one returns one of its two arguments</p>



<a name="199551160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551160">(Jun 02 2020 at 20:47)</a>:</h4>
<p>so you can say that the first one is a "subtype" of the latter</p>



<a name="199551183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551183">(Jun 02 2020 at 20:47)</a>:</h4>
<p>because any function that returns its first argument is <em>also</em> a function that returns one of its two arguments</p>



<a name="199551258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551258">(Jun 02 2020 at 20:48)</a>:</h4>
<p>(the reverse is not true, clearly)</p>



<a name="199551326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551326">(Jun 02 2020 at 20:48)</a>:</h4>
<p>anyway, so to get back to specifics, to some extent what we would be doing is modifying the unification code to thread a bit of "variance" down</p>



<a name="199551341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551341">(Jun 02 2020 at 20:48)</a>:</h4>
<p>or maybe it'd be better to call it "direction"</p>



<a name="199551353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551353">(Jun 02 2020 at 20:48)</a>:</h4>
<p>(i.e., I kind of abused an existing enum here in rustc)</p>



<a name="199551365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551365">(Jun 02 2020 at 20:48)</a>:</h4>
<p>Aren't we partially doing borrow checking by introducing all this? Feels like the boundary with polonius is getting fuzzy</p>



<a name="199551371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551371">(Jun 02 2020 at 20:48)</a>:</h4>
<p>nope</p>



<a name="199551379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551379">(Jun 02 2020 at 20:49)</a>:</h4>
<p>we are producing constraints that polonius wants as input</p>



<a name="199551403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551403">(Jun 02 2020 at 20:49)</a>:</h4>
<p>polonius doesn't understand types, it just wants to know things like <code>'a: 'b</code></p>



<a name="199551427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551427">(Jun 02 2020 at 20:49)</a>:</h4>
<p>and we're not failing to solve when the borrows are invalid?</p>



<a name="199551446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551446">(Jun 02 2020 at 20:49)</a>:</h4>
<p>right, the borows etc are not computed (yet)</p>



<a name="199551514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551514">(Jun 02 2020 at 20:50)</a>:</h4>
<p>ah, so the ordering (of inputs/outputs) avoids that problem. Got it</p>



<a name="199551522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551522">(Jun 02 2020 at 20:50)</a>:</h4>
<p>we are producing the constraints that the borrows must meet -- polonius's (or the existing NLL checker's) job is to figure out if you can satisfy those constraints without violating the other borrow checker rules</p>



<a name="199551614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551614">(Jun 02 2020 at 20:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199551326">said</a>:</p>
<blockquote>
<p>anyway, so to get back to specifics, to some extent what we would be doing is modifying the unification code to thread a bit of "variance" down</p>
</blockquote>
<p>yeah so let's say we have <code>Subtype(T1, T2)</code>, it might invoke the "TypeRelation" code with <code>(T1, &lt;:, T2)</code></p>



<a name="199551635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551635">(Jun 02 2020 at 20:51)</a>:</h4>
<p>whereas the existing unification might invoke that code with <code>(T1, ==, T2)</code></p>



<a name="199551657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551657">(Jun 02 2020 at 20:51)</a>:</h4>
<p>(does that notation make sense?)</p>



<a name="199551764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551764">(Jun 02 2020 at 20:52)</a>:</h4>
<p>so what does that mean?</p>



<a name="199551774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551774">(Jun 02 2020 at 20:52)</a>:</h4>
<p>well, for regular types, it doesn't mean too much yet</p>



<a name="199551786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551786">(Jun 02 2020 at 20:52)</a>:</h4>
<p>that is to say</p>



<a name="199551800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551800">(Jun 02 2020 at 20:52)</a>:</h4>
<p>mostly the code is the same until you get to the point where you are relating lifetimes</p>



<a name="199551829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551829">(Jun 02 2020 at 20:52)</a>:</h4>
<p>(I'll get to the point where it's not)</p>



<a name="199551852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551852">(Jun 02 2020 at 20:52)</a>:</h4>
<p>but mostly you're just kidn of propagating that "direction" (<code>&lt;:</code>, <code>==</code>, etc) down</p>



<a name="199551878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551878">(Jun 02 2020 at 20:53)</a>:</h4>
<p>when you get to two lifetimes, though, the region constraints we produce will depend on the constraint</p>



<a name="199551893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551893">(Jun 02 2020 at 20:53)</a>:</h4>
<p>so that's why I said the first step is to modify our approach to region constraints</p>



<a name="199551897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551897">(Jun 02 2020 at 20:53)</a>:</h4>
<p>today we only produce equality constraints</p>



<a name="199551907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551907">(Jun 02 2020 at 20:53)</a>:</h4>
<p>So, would we just add a <code>Variance</code> argument to <code>Zip</code>?</p>



<a name="199551912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551912">(Jun 02 2020 at 20:53)</a>:</h4>
<p>but if we instead produce 'outlives' constraints (<code>'a: 'b</code>, not <code>'a == 'b</code>)</p>



<a name="199551939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551939">(Jun 02 2020 at 20:53)</a>:</h4>
<p>then we can look at the direction and either produce <code>'a: 'b</code>, <code>'b: 'a</code>, or both</p>



<a name="199551946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199551946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199551946">(Jun 02 2020 at 20:53)</a>:</h4>
<p>depending on what it is</p>



<a name="199552074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552074">(Jun 02 2020 at 20:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020/near/199551907">said</a>:</p>
<blockquote>
<p>So, would we just add a <code>Variance</code> argument to <code>Zip</code>?</p>
</blockquote>
<p>probably yes. This is not what rustc did, instead it is tracked in a field, but I think the code would be cleaner if it were a parameter. The question is whether the rustc equivalent of <code>Zip</code> (<code>TypeRelation</code>) is used in any context where it doesn't care about ambient variance? I think the answer is actually no, though some of the code is factored in a way as to make it seem like the answer is yes :)</p>



<a name="199552183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552183">(Jun 02 2020 at 20:55)</a>:</h4>
<p>so there are a few twists I didn't get to</p>



<a name="199552191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552191">(Jun 02 2020 at 20:55)</a>:</h4>
<p>but that's the high-level idea</p>



<a name="199552199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552199">(Jun 02 2020 at 20:55)</a>:</h4>
<p>I had never realized that <code>Zip</code> was the equivalent of <code>TypeRelation</code></p>



<a name="199552279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552279">(Jun 02 2020 at 20:56)</a>:</h4>
<p>pretty much</p>



<a name="199552291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552291">(Jun 02 2020 at 20:56)</a>:</h4>
<p>I like the name Zip a bit better ;)</p>



<a name="199552307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552307">(Jun 02 2020 at 20:56)</a>:</h4>
<p>in that I think it's kind of clearer what it does (by analogy...)</p>



<a name="199552329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552329">(Jun 02 2020 at 20:56)</a>:</h4>
<p>but you all would be the ones to tell me which is more confusing in real life</p>



<a name="199552347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552347">(Jun 02 2020 at 20:56)</a>:</h4>
<p>I like <code>Zip</code></p>



<a name="199552378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552378">(Jun 02 2020 at 20:57)</a>:</h4>
<p>in any case, the main twist I didn't get to is variance</p>



<a name="199552402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552402">(Jun 02 2020 at 20:57)</a>:</h4>
<p>which is basically "how does the direction change as we walk down the type"</p>



<a name="199552404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552404">(Jun 02 2020 at 20:57)</a>:</h4>
<p>3 minute summary?</p>



<a name="199552424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552424">(Jun 02 2020 at 20:57)</a>:</h4>
<p>heh that's probably the "summary" part</p>



<a name="199552441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552441">(Jun 02 2020 at 20:57)</a>:</h4>
<p>lol</p>



<a name="199552452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552452">(Jun 02 2020 at 20:57)</a>:</h4>
<p>I guess I'll try this</p>



<a name="199552515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552515">(Jun 02 2020 at 20:58)</a>:</h4>
<p>consider <code>fn(T1) &lt;: fn(T2)</code></p>



<a name="199552531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552531">(Jun 02 2020 at 20:58)</a>:</h4>
<p>i.e., we have a function that takes T1 values</p>



<a name="199552539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552539">(Jun 02 2020 at 20:58)</a>:</h4>
<p>and a function taht takes T2 values</p>



<a name="199552564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552564">(Jun 02 2020 at 20:58)</a>:</h4>
<p>if T1 &lt;: T2, so every T1 is a T2,</p>



<a name="199552591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552591">(Jun 02 2020 at 20:58)</a>:</h4>
<p>then is fn(T1) &lt;: fn(T2)?</p>



<a name="199552592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552592">(Jun 02 2020 at 20:58)</a>:</h4>
<p>the answer is no</p>



<a name="199552674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552674">(Jun 02 2020 at 20:59)</a>:</h4>
<p>basically because every function that takes T2 values is also a function that takes T1 values</p>



<a name="199552683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552683">(Jun 02 2020 at 20:59)</a>:</h4>
<p>since every T1 value is a T2 value</p>



<a name="199552703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552703">(Jun 02 2020 at 20:59)</a>:</h4>
<p>therefore the correct relation is <code>fn(T2) &lt;: fn(T1)</code></p>



<a name="199552711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552711">(Jun 02 2020 at 20:59)</a>:</h4>
<p>note the reverse in direction</p>



<a name="199552720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552720">(Jun 02 2020 at 20:59)</a>:</h4>
<p>this is called "contravariance"</p>



<a name="199552762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552762">(Jun 02 2020 at 20:59)</a>:</h4>
<p>and I feel like my choice of names (T1, T2) or the way I approached the topic did not make it particularly clear ;)</p>



<a name="199552884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552884">(Jun 02 2020 at 21:00)</a>:</h4>
<p>but basically what I'm trying to say is that when you are relating <code>fn(A)</code> and <code>fn(B)</code>, you will need to recursively relate <code>A</code> and <code>B</code>, but the direction switches (beacuse function parameters are "contra" variant)</p>



<a name="199552898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552898">(Jun 02 2020 at 21:00)</a>:</h4>
<p>i.e., contra == against, the direction changes</p>



<a name="199552924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552924">(Jun 02 2020 at 21:00)</a>:</h4>
<p>co == with, so if things are <em>covariant</em> the direction stays the same</p>



<a name="199552953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199552953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199552953">(Jun 02 2020 at 21:01)</a>:</h4>
<p>invariant == they must be equal, diretion changes to equality</p>



<a name="199553068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553068">(Jun 02 2020 at 21:01)</a>:</h4>
<p>so anyway the bottom line is that when you are zipping "component types" of some type T you have to alter the direction based on the variance of that component with respect to T</p>



<a name="199553105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553105">(Jun 02 2020 at 21:01)</a>:</h4>
<p>let me just point you to how that looks in the rustc code and make it's clearer</p>



<a name="199553199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553199">(Jun 02 2020 at 21:02)</a>:</h4>
<p>I know we're a bit past time</p>



<a name="199553224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553224">(Jun 02 2020 at 21:02)</a>:</h4>
<p>But, do we have to keep track of those switches in Chalk</p>



<a name="199553283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553283">(Jun 02 2020 at 21:02)</a>:</h4>
<p>yes, there is going to have to be a <code>RustIrDatabase</code> callback</p>



<a name="199553318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553318">(Jun 02 2020 at 21:02)</a>:</h4>
<p>because for things like structs or ADTs</p>



<a name="199553335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553335">(Jun 02 2020 at 21:03)</a>:</h4>
<p>we infer the variance and chalk will have to ask for it</p>



<a name="199553401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553401">(Jun 02 2020 at 21:03)</a>:</h4>
<p>i.e., <code>Vec</code> is covariant with respect to its type parameter, so if you have <code>Vec&lt;T&gt;</code> related to <code>Vec&lt;U&gt;</code>, you keep the direction unchanged when you zip <code>T</code> and <code>U</code></p>



<a name="199553430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553430">(Jun 02 2020 at 21:03)</a>:</h4>
<p>but <code>Cell</code> is invariant, so there we would change direction to <code>==</code></p>



<a name="199553514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553514">(Jun 02 2020 at 21:04)</a>:</h4>
<p>here is <a href="https://github.com/rust-lang/rust/blob/db98d32ea04438cf759b749d5cbeba4f77222664/src/librustc_middle/ty/relate.rs#L144-L147">code from rustc that handles the case of ADTs</a></p>



<a name="199553569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553569">(Jun 02 2020 at 21:04)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/db98d32ea04438cf759b749d5cbeba4f77222664/src/librustc_middle/ty/relate.rs#L185">this code handles function arguments</a></p>



<a name="199553596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553596">(Jun 02 2020 at 21:04)</a>:</h4>
<p>huh, didn't think that variance would be inferred. interesting</p>



<a name="199553619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553619">(Jun 02 2020 at 21:04)</a>:</h4>
<p>interesting quirk of rust for you</p>



<a name="199553680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553680">(Jun 02 2020 at 21:05)</a>:</h4>
<p>gotta run hope that helped some</p>



<a name="199553701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553701">(Jun 02 2020 at 21:05)</a>:</h4>
<p>maybe we can add a link to this from <a href="https://github.com/rust-lang-nursery/chalk/issues/418">chalk#418</a></p>



<a name="199553712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553712">(Jun 02 2020 at 21:05)</a>:</h4>
<p>Thanks :)</p>



<a name="199553727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553727">(Jun 02 2020 at 21:05)</a>:</h4>
<p>Yeah, I can add a link</p>



<a name="199553748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553748">(Jun 02 2020 at 21:05)</a>:</h4>
<p>(happy to dive in more detail later)</p>



<a name="199553891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199553891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199553891">(Jun 02 2020 at 21:06)</a>:</h4>
<p>I know that C# for example allows you to annotate variance if it can't be inferred, I guess that's not relevant for Rust?</p>



<a name="199554069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/meeting%2006.02.2020/near/199554069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/meeting.2006.2E02.2E2020.html#199554069">(Jun 02 2020 at 21:07)</a>:</h4>
<p>we don't allow it, we could</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>